package com.surfacing.rcp.client.editors;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CBanner;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.layout.TableColumnLayout;

public class UserView extends ViewPart {
	
	public static final String ID = "com.surfacing.rcp.ui.views.UserView";
	private Text inputSearchField;
	private Text inputCreateFirstName;
	private Text inputCreateLastName;
	private Table table;
	public UserView() {
	}

	@Override
	public void createPartControl(Composite parent) {
		parent.setLayout(new GridLayout(1, false));
		
		TabFolder tabFolder = new TabFolder(parent, SWT.NONE);
		tabFolder.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 1));
		
		TabItem tabSearchItem = new TabItem(tabFolder, SWT.NONE);
		tabSearchItem.setText("Suche");
		
		Group group = new Group(tabFolder, SWT.NONE);
		tabSearchItem.setControl(group);
		group.setLayout(new GridLayout(11, false));
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		
		Button btnSearchNfs = new Button(group, SWT.RADIO);
		btnSearchNfs.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		btnSearchNfs.setSize(42, 16);
		btnSearchNfs.setText("NFS");
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		
		Button btnSearchArzt = new Button(group, SWT.RADIO);
		btnSearchArzt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		btnSearchArzt.setSize(42, 16);
		btnSearchArzt.setText("Arzt");
		
		Label lblNachname = new Label(group, SWT.NONE);
		lblNachname.setSize(58, 15);
		lblNachname.setText("Suche");
		
		inputSearchField = new Text(group, SWT.BORDER);
		GridData gd_inputSearchField = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_inputSearchField.widthHint = 200;
		inputSearchField.setLayoutData(gd_inputSearchField);
		inputSearchField.setSize(76, 21);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		
		Button btnSearchAzubi = new Button(group, SWT.RADIO);
		btnSearchAzubi.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		btnSearchAzubi.setSize(51, 16);
		btnSearchAzubi.setText("Azubi");
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		
		Button btnSearchUser = new Button(group, SWT.NONE);
		GridData gd_btnSearchUser = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_btnSearchUser.widthHint = 100;
		btnSearchUser.setLayoutData(gd_btnSearchUser);
		btnSearchUser.setSize(44, 25);
		btnSearchUser.setText("Suche");
		
		TabItem tabNewUser = new TabItem(tabFolder, SWT.NONE);
		tabNewUser.setText("Neuer Mitarbeiter");
		
		Group group_1 = new Group(tabFolder, SWT.NONE);
		tabNewUser.setControl(group_1);
		group_1.setLayout(new GridLayout(11, false));
		
		Label label = new Label(group_1, SWT.NONE);
		label.setText("Vorname");
		label.setBounds(0, 0, 48, 15);
		
		inputCreateFirstName = new Text(group_1, SWT.BORDER);
		GridData gd_inputCreateFirstName = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_inputCreateFirstName.widthHint = 200;
		inputCreateFirstName.setLayoutData(gd_inputCreateFirstName);
		inputCreateFirstName.setBounds(0, 0, 212, 21);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		
		Button radioCreateNfs = new Button(group_1, SWT.RADIO);
		radioCreateNfs.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		radioCreateNfs.setText("NFS");
		radioCreateNfs.setBounds(0, 0, 42, 16);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		
		Button radioCreateArzt = new Button(group_1, SWT.RADIO);
		radioCreateArzt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		radioCreateArzt.setText("Arzt");
		radioCreateArzt.setBounds(0, 0, 42, 16);
		
		Label label_1 = new Label(group_1, SWT.NONE);
		label_1.setText("Nachname");
		label_1.setBounds(0, 0, 58, 15);
		
		inputCreateLastName = new Text(group_1, SWT.BORDER);
		GridData gd_inputCreateLastName = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_inputCreateLastName.widthHint = 200;
		inputCreateLastName.setLayoutData(gd_inputCreateLastName);
		inputCreateLastName.setBounds(0, 0, 76, 21);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		
		Button radioCreateAzubi = new Button(group_1, SWT.RADIO);
		radioCreateAzubi.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
		radioCreateAzubi.setText("Azubi");
		radioCreateAzubi.setBounds(0, 0, 51, 16);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		
		Button btnCreateUser = new Button(group_1, SWT.NONE);
		GridData gd_btnCreateUser = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
		gd_btnCreateUser.widthHint = 100;
		btnCreateUser.setLayoutData(gd_btnCreateUser);
		btnCreateUser.setText("Erstellen");
		btnCreateUser.setBounds(0, 0, 44, 25);
		
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setLayout(new GridLayout(1, false));
		
		Composite resultTable = new Composite(composite, SWT.NONE);
		resultTable.setBounds(0, 0, 64, 64);
		resultTable.setLayout(new TableColumnLayout());
		
		TableViewer tableViewer = new TableViewer(resultTable, SWT.BORDER | SWT.FULL_SELECTION);
		table = tableViewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		// TODO Auto-generated method stub

	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}
}
